package com.nl.lib_core.tool.coroutines.extension

import kotlinx.coroutines.Job

/** 作者: wangfei 创建时间: 2021/12/27 包名: com.nl.lib_core.tool.coroutines.extension 类名: JobExtension */
fun Job.safeCancel() {
  if (isActive) {
    cancel()
  }
}

fun cancelAllJobs(vararg jobs: Job) {
  jobs.forEach { it.safeCancel() }
}
